package uk.co.cocking.getinline2.pipeline.io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.List;

import uk.co.cocking.getinline2.pipeline.transformers.AbstractTransformer;

public class FileLineReader extends
		AbstractTransformer<String, String> {

	@Override
	public List<String> transform(String incomingItem)
			throws CouldNotProcessRecordException {
		LineReader reader;
		try {
			reader = new LineReader(new FileReader(incomingItem));
			return reader.lines();
		} catch (FileNotFoundException e) {
			throw new CouldNotProcessRecordException("Could not read lines from file "+incomingItem, e);
		}
	}

}
